package com.mes.utils;

import java.util.Properties;

public class PropertiesUtils {
	private static Properties props = null;
	
	public static String getValue(String name) {
		if (props == null)
			getProperties();
		return props.getProperty(name);
	}
	
	public static void getProperties() {
		try {
			props = new Properties();
			ClassLoader loader = Thread.currentThread().getContextClassLoader();
			props.load(loader.getResourceAsStream("conf/jdbc.properties"));
		} catch (Exception e) {
			System.out.println("系统配置文件conf/jdbc.properties读取失败！！！");
			props = null;
		}
	}
	
	public static void main(String[] args) {
		System.out.println(getValue("CAIGOU_IN"));
	}
}